package com.szeastroc.core.service.system;

import java.util.List;

import com.szeastroc.core.base.service.BaseService;
import com.szeastroc.core.bean.system.SystemResource;
import com.szeastroc.core.bean.system.ZTreeNode;

/**
 * Created by jie on 2018/1/6.
 */
public interface SystemResourceService extends BaseService<SystemResource>{

    public List<SystemResource> getSystemResource(Integer userId,Integer roleId);

    /**
     * 根据角色ID,查询对应的权限
     * @param roleId
     * @return
     */
    public List<SystemResource> getSystemResourceByRoleId(Integer roleId);

    /**
     * 根据角色id查询出权限树（并勾选上角色拥有的权限）
     * @param roleId
     * @return
     */
    public List<ZTreeNode> getAllSystemResourceTreeByRoleId(Integer roleId);

    /**
     * 保存角色权限
     * @param resourceIds
     * @param roleId
     */
    public void saveRoleResources(String resourceIds,Integer roleId);

    /**
     * 修改菜单权限状态
     * @param resourceId
     * @param status
     */
    public void saveResourcesStatus(Integer resourceId,Integer status);

    public List<SystemResource> getSystemResourceParentByRoleIds(String ids);

    public List<SystemResource> getSystemResourceByParentId(Integer id);
    
    /**
     * 根据角色id获取左侧菜单树
     * @param ids
     * @return
     */
    public List<SystemResource> getSystemResourceByRoleIds(String ids);

    /**
     * 获取所有权限树
     * @return
     */
    public List<ZTreeNode> getAllRoleResource();
}
